package com.airsystem.pos.bengkel.component;

import java.beans.PropertyVetoException;

import javax.swing.JInternalFrame;

import org.apache.log4j.Logger;

import com.airsystem.pos.bengkel.controller.MenuController;
import com.airsystem.pos.bengkel.view.dialog.MasterBillingDetailDialog;
import com.airsystem.pos.bengkel.view.dialog.MasterBillingDialog;
import com.airsystem.pos.bengkel.view.dialog.MasterCustomerDialog;
import com.airsystem.pos.bengkel.view.dialog.MasterEmployeeDialog;
import com.airsystem.pos.bengkel.view.dialog.MasterServiceDialog;
import com.airsystem.pos.bengkel.view.dialog.MasterServiceTypeDialog;
import com.airsystem.pos.bengkel.view.dialog.MasterSparepartDialog;
import com.airsystem.pos.bengkel.view.dialog.MasterSparepartTypeDialog;
import com.airsystem.pos.bengkel.view.dialog.MasterVehicleDialog;
import com.airsystem.pos.bengkel.view.dialog.ServiceOrderDialog;
import com.airsystem.pos.bengkel.view.dialog.SparepartOrderDialog;
import com.airsystem.pos.bengkel.view.dialog.UserManagementDialog;

/**
 * @author Budi Oktaviyan <budi.oktaviyan@icloud.com>
 */
public class DesktopFrame extends JInternalFrame {
	private static final Logger LOG = Logger.getLogger(DesktopFrame.class.getSimpleName());

	protected boolean isMaximum = false;

	protected MenuController menuController;

	protected UserManagementDialog dialogUserManagement;

	protected MasterEmployeeDialog dialogMasterEmployee;

	protected MasterBillingDialog dialogMasterBilling;

	protected MasterBillingDetailDialog dialogMasterBillingDetail;

	protected MasterVehicleDialog dialogMasterVehicle;

	protected MasterCustomerDialog dialogMasterCustomer;

	protected MasterSparepartTypeDialog dialogMasterSparepartType;

	protected MasterSparepartDialog dialogMasterSparepart;

	protected MasterServiceTypeDialog dialogMasterServiceType;

	protected MasterServiceDialog dialogMasterService;

	protected SparepartOrderDialog dialogSparepartOrder;

	protected ServiceOrderDialog dialogServiceOrder;

	public void setMaximum(boolean b) {
		isMaximum = b;

		if (isVisible() == false) {
			return;
		}

		try {
			super.setMaximum(b);
		} catch (PropertyVetoException vetoEx) {
			LOG.error(vetoEx.getMessage(), vetoEx);
		}
	}

	protected boolean getMaximum() {
		return isMaximum;
	}

	public void setVisible(boolean b) {
		super.setVisible(b);

		if (isMaximum == true) {
			setMaximum(true);
		}
	}
}